package com.piggy.logi.sys.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 运营操作类型枚举
 */
@Getter
@AllArgsConstructor
public enum OperationTypeEnum {

    LOAD("load", "load", "运营管理-装车"),
    CANCEL_LOAD("cancelLoad", "cancelLoad", "运营管理-取消装车"),
    DEPART("depart", "depart", "运营管理-发车"),
    CANCEL_DEPART("cancelDepart", "cancelDepart", "运营管理-取消发车");

    private final String type;
    private final String methodName;
    private final String desc;

    public static OperationTypeEnum fromType(String type) {
        for (OperationTypeEnum operationType : OperationTypeEnum.values()) {
            if (operationType.getType().equals(type)) {
                return operationType;
            }
        }
        throw new IllegalArgumentException("Invalid operation type: " + type);
    }
}
